]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionSystem: Require Extensions app for updates
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 11 Mar 2020 19:09:11 +0000 (20:09 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 27 Mar 2020 13:28:41 +0000 (13:28 +0000)
While we don't technically need the app to download and apply
updates, we do require it for notifying the user about available
updates and listing extensions with pending updates.

So instead of intransparently applying updates in the background
without the user noticing, disable updates altogether if the
Extensions app is not installed.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2346

js/ui/extensionDownloader.js
js/ui/extensionSystem.js

index 306aaf14fb3b9299fae09eee757018a9eeb78805..08ebc2fec994fcf37154f9d297c1d78e1b34ae50 100644 (file)
@@ -108,6 +108,9 @@ function gotExtensionZipFile(session, message, uuid, dir, callback, errback) {
 }
 
 function downloadExtensionUpdate(uuid) {
+    if (!Main.extensionManager.updatesSupported)
+        return;
+
     let dir = Gio.File.new_for_path(
         GLib.build_filenamev([global.userdatadir, 'extension-updates', uuid]));
 
@@ -126,6 +129,9 @@ function downloadExtensionUpdate(uuid) {
 }
 
 function checkForUpdates() {
+    if (!Main.extensionManager.updatesSupported)
+        return;
+
     let metadatas = {};
     Main.extensionManager.getUuids().forEach(uuid => {
         let extension = Main.extensionManager.lookup(uuid);
index f2e8db79d2ccb20b066ad5c6ac5781375b4f337b..4fab0c334efa3a0373f510a1d8a7204281e32154 100644 (file)
@@ -60,6 +60,11 @@ var ExtensionManager = class {
         ExtensionDownloader.checkForUpdates();
     }
 
+    get updatesSupported() {
+        const appSys = Shell.AppSystem.get_default();
+        return appSys.lookup_app('org.gnome.Extensions.desktop') !== null;
+    }
+
     lookup(uuid) {
         return this._extensions.get(uuid);
     }
@@ -481,6 +486,9 @@ var ExtensionManager = class {
     }
 
     _installExtensionUpdates() {
+        if (!this.updatesSupported)
+            return;
+
         FileUtils.collectFromDatadirs('extension-updates', true, (dir, info) => {
             let fileType = info.get_file_type();
             if (fileType !== Gio.FileType.DIRECTORY)